//导入
const db = require('./db/db');
const MovieModel = require('./db/models/MovieModel')

//调用该函数
db(() => {
  //成功
  MovieModel.create({
    name: '让子弹飞',
    type: '搞笑 喜剧',
    actors: ['姜文','葛优','周润发','廖凡'],
    director: '姜文'
  }, (err, data) => {
    if(err) throw err;
    console.log(data);
  })
}, () => {
  console.log('连接失败~~');
})

/**
 * 
 *  {
 *    username: 'haiyang',
 *    password: '123456'
 *    profile: '/xyddd.png'
 * }
 * 
 * // public
 * xyddd.png
 * 
 */